<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title></title>
	<link href="<%=path%>/css/style_min.css" rel="stylesheet" type="text/css"/>
    <link href="<%=path%>/css/core.css" rel="stylesheet" type="text/css"/>
    <link href="<%=path%>/css/form.css" rel="stylesheet" type="text/css"/>
    <link href="<%=path%>/css/list.css" rel="stylesheet" type="text/css"/>
    <link href="<%=path%>/css/SupplierSelect.css" rel="stylesheet" type="text/css"/>
    <link href="<%=path%>/css/UsersSelect.css" rel="stylesheet" type="text/css"/>
    <link href="<%=path%>/css/xWindowPanel.css" rel="stylesheet" type="text/css"/>
    <link href="<%=path%>/css/xToolbar.css" rel="stylesheet" type="text/css"/>
    <script src="<%=path%>/js/prototype_for_validation.js" type="text/javascript"></script>
    <script src="<%=path%>/js/validation_cn.js" type="text/javascript"></script>
    <style type="text/css">
    input { width: 180px;}
    textarea { width: 503px; height: 40px;}
    select { width: 188px;}
    .n { text-align: right;}
    </style>
  </head>
  <body>
    <form name="salesOrderOutForm" id="salesOrderOutForm" action="<%=path%>/sales/salesOrder/saveOut.t4m" class="form" method="post">
    <input type="hidden" name="object.id" value="${object.id}"/> 
    <div class="form-group">出库单明细</div>
         <table class="form-table" cellspacing="0" cellpadding="0">
        <tr>
          <td class="form-left" width="10%">销售单编号</td>
          <td class="form-right" width="40%">${object.salesOrder.code}</td>
          <td class="form-left" width="10%">发票编号</td>
          <td class="form-right" width="40%">${object.salesOrder.billCode}</td>
        </tr>
        <tr>
          <td class="form-left">出库单编号</td>
          <td class="form-right">${object.code}</td>
          <td class="form-left">出库日期</td>
          <td class="form-right"><s:date name="object.outStockDate" format="yyyy-MM-dd" /></td>
        </tr>
        <tr>
          <td class="form-left">出库单总价</td>
          <td class="form-right">${object.salesOrder.totalPrice}</td>
        </tr>
      </table>
   
      <div id="toolbar"></div>
      <table id="titleTable" cellpadding="0" cellspacing="0">
        <tr>
          <td>&nbsp;</td>
          <td>货品编号</td>
          <td>货品名称</td>
          <td>价格</td>
          <td>数量(个)</td>
          <td>合计</td>
           <td>仓库</td>
        </tr>
      </table>
      <table id="dataTable" cellpadding="0" cellspacing="0">
        <s:iterator id="outProduct" value="itemList" status="i">
          <tr class="row">
            <td class="num"><s:property value="#i.index+1"/></td>
            <td><span><s:property value="#outProduct.product.code"/></span></td>
            <td><span><s:property value="#outProduct.product.name"/></span></td>
            <td><span><s:property value="#outProduct.salesPrice"/></span></td>
            <td><span><s:property value="#outProduct.amounts"/></span></td>
            <td><span><s:property value="#outProduct.lastPrice"/></span></td>
            <input type="hidden" name="outOrderProducts[${i.index}].product.id" value='<s:property value="#outProduct.product.id"/>'/>
            <input type="hidden" name="outOrderProducts[${i.index}].amounts" value='<s:property value="#outProduct.amounts"/>' />
            <input type="hidden" name="outOrderProducts[${i.index}].warehouse.id" value='<s:property value="#outProduct.warehouse.id"/>' />
           
            <td><span>
                  <s:property value="#outProduct.warehouse.name"/>    
            </span></td>

          </tr>
        </s:iterator>
      </table>
      <s:hidden name="tabId"/>
      <s:hidden name="windowPanelId"/>
    </form>
    <script src="<%=path%>/js/share.js" type="text/javascript"></script>
    <script src="<%=path%>/js/jquery.js" type="text/javascript"></script>
    <script src="<%=path%>/js/datePicker/WdatePicker.js" type="text/javascript"></script>
  <script src="<%=path%>/js/Grid.js" type="text/javascript"></script>
    <script type="text/javascript" src="<%=path%>/js/BoxSelect.js"></script>
    <script type="text/javascript">
    var indexNum=0,grid;
    
    $(document).ready(function(){
      
      grid = new Grid({
        titleTable:'titleTable',
        dataTable:'dataTable',
        widths : [24,120,120,90,100,100],
        height : 268
      });
      
      loadReady();
    });
    
      function sumPrice(arg0,arg1,arg2){
        var value1 = arg1.value;
        var value2 = document.getElementById(arg2).value;
        $("#td_" + arg0).html(value1 * value2);
        $("#hid_total" + arg0).val(value1 * value2);
      } 
      
      function delData(id) {
        $('#'+id).remove();
        indexNum--;
      }
   	var valid = new Validation('salesOrderOutForm',{immediate:true});
    </script>
  </body>
</html>